/* Copyright (c) 2022-2025 Qualcomm Technologies International, Ltd. */
/* %%version */

#ifndef GATT_XPAN_CLIENT_COMMON_H_
#define GATT_XPAN_CLIENT_COMMON_H_

#include "csr_synergy.h"

#ifndef EXCLUDE_GATT_XPAN_CLIENT_MODULE

#include "gatt_xpan_client.h"
#include "gatt_xpan_client_private.h"

#define XPAN_ADD_SERVICE_HANDLE(_List) \
    (ServiceHandleListElm_t *)CsrCmnListElementAddLast(&(_List), \
                                              sizeof(ServiceHandleListElm_t))

ServiceHandle getXpanServiceHandle(GXPANC **gatt_xpan_client, CsrCmnList_t *list);


void xpanClientBufferWithLengthDecode(GattXpanClientBufferWithLength* buff,
                                             const uint8** pdataPtr,
                                             const uint8* const lastPtr);

void xpanClientBufferFixedLengthDecode(uint8* buffer,
                                       uint8 length,
                                       const uint8** pdataPtr,
                                       const uint8* const lastPtr);

void xpanClientDecodeStoredSsid(GattXpanClientStoredSsid* storedSsid, uint16 size_value, const uint8 *value);
/*
 * void xpanClientDecodeIpv4Address(GattXpanClientIpv4Address* ipv4Address, uint16 size_value, const uint8 *value);
 * void xpanClientDecodeIpv6Address(GattXpanClientIpv6Address* ipv6Address, uint16 size_value, const uint8 *value);
 */
void xpanClientDecodeIpAddressData(GattXpanClientIpAddressData* const ipAddressData,
                                uint16 size_value,
                                const uint8 *value,
                                uint8 ipAddressLen);

void xpanClientDecodeL2capTcpPort(GattXpanClientL2capTcpPort* l2capTcpPort, uint16 size_value, const uint8 *value);
void xpanClientDecodeUdpPort(GattXpanClientUdpPort* udpPort, uint16 size_value, const uint8 *value);
void xpanClientDecodeConnectedDevices(GattXpanClientConnectedDevices* connectedDevices, uint16 size_value, const uint8 *value);
void xpanClientDecodeClearToSend(GattXpanClientClearToSend* clearToSend, uint16 size_value, const uint8 *value);
void xpanClientDecodeBearerPreference(GattXpanClientBearerPreference* bearerPreference, uint16 size_value, const uint8 *value);
void xpanClientDecodeMacAddresses(GattXpanClientMacAddresses* macAddresses, uint16 size_value, const uint8 *value);
void xpanClientDecodeRequestedSapPowerState(GattXpanClientSapPowerStateData* sapPowerStateData, uint16 size_value, const uint8 *value);
void xpanClientDecodeTwtConfiguration(GattXpanClientTwtConfiguration* twtConfiguration, uint16 size_value, const uint8 *value);
void xpanClientDecodeServerFeatures(GattXpanClientServerFeatures* serverFeatures, uint16 size_value, const uint8 *value);
void xpanClientDecodeAudioBearerSwitchResponse(AudioBearerSwitchResponse* audioBearerSwitchResponse, uint16 size_value, const uint8 *value);
void xpanClientDecodeNumDevicesPresent(NumDevicesPresent* numDevices, uint16 size_value, const uint8 *value);
void xpanClientDecodeVoiceBackChannelPeriodicity(VoiceBackChannelPeriodicity* periodicity, uint16 size_value, const uint8 *value);
void xpanClientRoamingRequestResponse(GattXpanClientStatus* status, uint16 size_value, const uint8 *value);

#endif /* EXCLUDE_GATT_XPAN_CLIENT_MODULE */
#endif /* GATT_XPAN_CLIENT_COMMON_H_ */
